package last.multicode.studentscore;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String text = scanner.next();
        String[] strs = text.split(";");
        Student[] students = new Student[strs.length];
        for (int i = 0; i < strs.length; i++) {
            String str = strs[i];
            String[] array = str.split(",");
            String name = array[0];
            int dailyScore = Integer.parseInt(array[1]);
            int finalScore = Integer.parseInt(array[2]);
            Score score = new Score(dailyScore, finalScore);
            students[i] = new Student(name, score);
        }
        Lesson lesson = new Lesson(students);
        String studentName = scanner.next();
        lesson.printStudentScoreByName(studentName);
    }
}
